/**
 * Created by Heather on 2017/06/10.
 */
import Vue from 'vue'
import Vuex from 'vuex'

/*import PlayService from './PlayService'*/

Vue.use(Vuex)

export default new Vuex.Store({
        state: {
            count: 0,
            is_login: false,
            Province: '',
            City: '',
            District: '',
            city_show: false
        },
        mutations: {
            increment(state, n) {
                state.count += n
            },
            pretendLogin(state) {
                state.is_login = true;
            },
            setAddress(state, userAddress) {
                state.Province = userAddress.p;
                state.City = userAddress.c;
                state.District = userAddress.d;
            },
            setAddressShow(state, val) {
                state.city_show = val;
            }
        },
        actions: {
            increment(context) {
                context.commit('increment')
            },
            pretendLogin(context) {
                context.commit('pretendLogin')
            }
        }
    }
    /*{
      modules: {
        PlayService,
        ApiService,
        NotifyService
      }
    }*/
)